package com.example.cunwan_hd.controller;

import com.example.cunwan_hd.Pojo.UserPojo;
import com.example.cunwan_hd.Server.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/user")
@RestController
public class UserApi {
    @Autowired
    UserService userservice;
    @PostMapping("/login")
    public Map  login(@RequestBody UserPojo userPojo){
         return  userservice.login(userPojo);

    }
    @PostMapping("/register")
    public String register(@RequestBody  UserPojo userojo){
        return userservice.register(userojo);

    }

}
